home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / VIDEOTYP.CC < prev    next >
Text File  |  1993-04-04  |  1KB  |  35 lines

  1. #include <dos.h>
  2. #include <ctype.h>
  3. #include <stdlib.h>
  4. int color, mono, cga, ega, scrseg, bios;
  5. video_type()
  6. /* This will determine the Video type of the display.
  7.    This routine defines the following global definition.
  8.    int color, mono, cga, ega, bios, scrseg;
  9.    They can be used by other functions if you define them as external
  10.    definitions.
  11. */
  12. {
  13. char *pt_cga, *pt_bios;
  14. union REGS inregs, outregs;
  15.         color=mono=cga=ega=0;
  16.         int86(0x11,&inregs,&inregs);
  17.         if((inregs.h.al & 0x30) == 0x30) {
  18.             mono=1;
  19.             scrseg=0xb000u;
  20.         }
  21.         else {
  22.             color=1;
  23.             scrseg=0xb800u;
  24.         }
  25.         inregs.h.ah=0x12;
  26.         inregs.h.bl=0x10;
  27.         int86(0x10,&inregs,&outregs);
  28.         if(inregs.h.bl != outregs.h.bl) ega=1;
  29.         if(color && !ega) cga=1;
  30.         pt_cga=getenv("CGA");
  31.         if(pt_cga && toupper(*pt_cga) == 'Y') cga=1;
  32.         pt_bios=getenv("BIOS");
  33.         if(pt_bios && toupper(*pt_bios) == 'Y') bios=1;
  34. }
  35.